package mysql

import "gorm.io/gorm"

type Book struct {
	gorm.Model
	UserId     int64  `gorm:"type:int(11);comment:用户id"`
	NovelTitle string `gorm:"type:varchar(30);comment:小说名称"`
	Writer     string `gorm:"type:varchar(10);comment:作者"`
	BookCover  string `gorm:"type:varchar(300);comment:封面"`
	Degree     int64  `gorm:"type:int(11);comment:热点"`
	Status     int64  `gorm:"type:tinyint(1);default:1;comment:状态:1:待上架,2:上架,3:下架"`
}

func (b *Book) Create() error {
	return Db.Create(&b).Error
}
